package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.InspectionMapper;
import com.youlai.boot.system.mapper.PackageMapper;
import com.youlai.boot.system.model.QB.Package;
import com.youlai.boot.system.service.PackageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class PackageServiceImpl extends ServiceImpl<PackageMapper,Package> implements PackageService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private PackageMapper packageMapper;
    @Override
    public boolean savePackage(Package packag) {

        packag.setAddtime(LocalDateTime.now());
        return save(packag);
    }

    @Override
    public List<Package> getAllPackage() {
        return packageMapper.selectList(null);
    }

    @Override
    public boolean deletePackageById(Integer id) {
        return packageMapper.deleteById(id) > 0;
    }
}
